
<ion-view view-title='已完成' >
  <ion-content>
    <ion-refresher on-refresh="doRefresh()"
                   pulling-text="下拉刷新..."
                   refreshing-text="拼命加载中..."
                   refreshing-icon="ion-loading-b">

    </ion-refresher>
    <div class="list card" href="#">
      <div class="item" style="float: left;">
        <p >单数：{{summary.count || 0}}</p>
        <p >交账请查看收账报表</p>
        <!--<p >应收：{{summary.amount || 0}}</p>-->
      </div>
      <div class="item" style="float: right;" >
        <button class="button button-positive  button-outline "  ng-disabled='summary.count==0' ng-click="accountNow(tasks)">
          <i class="icon ion-calculator "></i>
          <b>清空已完成订单</b>
        </button>
      </div>
    </div>
      <div class="list card" ng-repeat="task in tasks" href="#">
        <div class="item">
          <h2>{{task.area_name}}-
            <span ng-if="(task.type != 9)" style="color: red;">{{task.type | orderTypeName}}</span>
            <span ng-if="(task.type === 9)">商家外卖</span>
            <span ng-bind-html="task.code | colorString">
            </span>
          </h2>
        </div>
        <div class="item item-body">
          <p>
            <i class="icon ion-ios-home" style="font-size: x-large;color: orange;"></i>
            {{task.to_address}}
          </p>
          <p>
            <i class="icon ion-ios-people" style="font-size: x-large;color: orange;"></i>
            {{task.to_name}}
            <a href="tel:{{task.to_tel}}">{{task.to_tel}}</a>
            <a href="tel:{{task.to_tel}}" class="icon ion-ios-telephone"></a>
          </p>
          <!--<p>
          下单时间：{{mymission.orderInfo.createdAt | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>-->
          <p >
            <i class="icon ion-social-yen" style="font-size: x-large;color: orange;"></i>
            {{task.pay_way | payway}} ({{task.final_amount}}元)
          </p>
        </div>
        <div class="row ">
          <div class="col">
            <button class="button button-calm button-small button-block" ng-click="gotoDetail(event,task.code)">
              <i class="icon ion-ios-book-outline "></i>
              <b>任务详情</b>
            </button>
          </div>
        </div>
      </div>
    <div ng-if="(tasks.length == 0)" class="card">
      <div class="item item-text-wrap">
        啥都没有~~
      </div>
    </div>
    <div style="text-align: center" ng-if="(loadmore.more === true)">
      <a style="color: green;text-align: center" ng-click="getMore()" >加载更多</a>
    </div>
    <div style="text-align: center" ng-if="(loadmore.more === false)">
      <a style="color: green;text-align: center" >~没有了~</a>
    </div>
  </ion-content>
</ion-view>
